import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import*
testCase="DBshop001_线下支付流程"


# 1.在首页搜索"小米",点击搜索按钮
firefox=openBrowser(url) #调用自定义函数打开网页,url的值是在testData文件中定义的
#调用自定义函数进行登录
DBshopLogin(firefox,userName,password)
# 11.到dbshop前台我的订单中完成收货
firefox.get(url)
#点击我的订单
firefox.find_element_by_link_text('我的订单').click()
#点击已发货
firefox.find_element_by_partial_link_text('已发货').click()
firefox.find_element_by_name('search_order_sn').send_keys('1666512668430002')
firefox.find_element_by_xpath('//button').click()
time.sleep(5)
#下拉右侧滚动条
firefox.execute_script("window.scrollTo(0,300)")
# priceElement=firefox.find_element_by_id('goods_price_8')
#点击确认收货
firefox.find_element_by_xpath('//button[text()="确认收货"]').click()
firefox.switch_to.alert.accept()